﻿using ReflectionStudio.Components.UserControls;
using ReflectionStudio.Core.Events;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Data;
namespace WPFExcelReport
{
    public partial class TSTVK05
    {
        

        VVRPOS VRP;
        VVKKOPF VKK;
        VVRKOPF VRK;
        VVKPOS VKP;
        VWDECK WD;
        VWGBST WG;
        VTXTIND TXT;

        public TSTVK05()
        {
            
            InitializeComponent();
            this.Name = "销售管理";
            SetUp();
        }
        private void SetUp()
        { 
            List<string> deftxt = new List<string>();
            deftxt = new List<string>();
            deftxt.Add("00please type your remark after remove this:"); 
            cVKK.PRTYPE = "TSTVK04";
            cVKK.IsCheckKD = true; 
            //cVKK.LFD = "000000";
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (IsLoaded)
                return;
            SetUpUserRight();
            IsLoaded = true;
        }
        public override void SetUpUserRight()
        {
            base.SetUpUserRight();
            Type mom = this.GetType();
            if (mom == null)
                return;
            string filter = "USERID='" + app.User + "' AND PROG='" + mom.Name.PadRight(80) + "'";
            DataRow[] rows = TBUR.Select(filter);
            foreach (DataRow row in rows)
            {
                string contol = row["CONTROLS"].ToString();//属性 
                string PROCESS = row["PROCESS"].ToString();//控制值
                string txt = row["P0"].ToString();//文本值 
                bool blControl = true;
                if (PROCESS.Trim() == "N")
                {
                    blControl = false; ;
                }
                if (PROCESS.Trim() == "Y")
                {
                    blControl = true; ;
                }
                switch (contol.Trim())
                {
                    case "DEL":
                        IsCanDelete = blControl;
                        break;
                    case "NEW":
                        IsCanNew = blControl;
                        break;
                    case "CHG":
                        IsCanChg = blControl;
                        break;
                    case "COPY":
                        IsCanCopy = blControl;
                        break;
                    case "MS":
                        ScopeManage = txt;
                        break;
                    case "CHGZA":
                        IsChgZA = blControl;
                        break;
                }
            }
        }
    }
}
